from __future__ import print_function

import grpc
import sys

sys.path.append('../')

from proto import helloworld_pb2
from proto import helloworld_pb2_grpc


def run():
    channel = grpc.insecure_channel('192.168.5.21:50051')
    stub = helloworld_pb2_grpc.GreeterStub(channel)

    response = stub.SayHello(helloworld_pb2.HelloRequest(name='you'))
    print("A1 client received: " + response.message)

    response = stub.SayHelloAgain(helloworld_pb2.HelloRequest(name='you2'))
    print("A2 client received: " + response.message)


if __name__ == '__main__':
    run()
